home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / DJGPP / LGP250S1.ZIP / src / libgplus.5 / libgplus / tests / tstring.exp < prev    next >
Text File  |  1992-05-06  |  1KB  |  50 lines

  1. an empty String:
  2. A string initialized to Hello:Hello
  3. A string initialized to previous string:Hello
  4. A string initialized to previous string.at(1, 2):el
  5. A string initialized to @:@
  6. A string initialized to dec(20):20
  7. n = 20 atoi(n) = 20 atof(n) = 20
  8. z = x + y = Helloworld
  9. x += y; x = Helloworld
  10. y.prepend(x); y = Helloworld
  11. cat(x, y, x, x); x = HelloworldHello
  12. cat(y, x, x, x); x = worldHelloHello
  13. z = x + s +  + y.at(w) + y.after(w) + . = Hello, world.
  14. ch = x[0] = H
  15. z = x.at(2, 3) = llo
  16. x.at(2, 2) = r; x = Hero
  17. x.at(0, 1) = j; x = jello
  18. x.at(He) = je; x = jello
  19. x.at(l, -1) = i; x = Helio
  20. z = x.at(r) = ello
  21. z = x.before(o) = Hell
  22. x.before(ll) = Bri; x = Brillo
  23. z = x.before(2) = He
  24. z = x.after(Hel) = lo
  25. x.after(Hel) = p; x = Help
  26. z = x.after(3) = o
  27. z =   a bc; z = z.after(RXwhite); z =a bc
  28. x.gsub(l, ll); x = Hellllo
  29. x.gsub(r, ...); x = Hello should have been replaced by this string
  30. x.gsub(RXwhite, #); x = Hello#should#have#been#replaced#by#this#string
  31. z = x+y; z.del(loworl); z = Held
  32. reverse(x) = olleH
  33. x.reverse() = olleH
  34. upcase(x) = HELLO
  35. downcase(x) = hello
  36. capitalize(x) = Hello
  37. z = replicate(*, 10) = **********
  38. z = This string    has
  39. five words
  40. from split(z, RXwhite, w, 10), n words = 5:
  41. This
  42. string
  43. has
  44. five
  45. words
  46. z = join(w, nw, /); z =This/string/has/five/words
  47. enter a word:word =abcdefghijklmnopqrstuvwxyz length = 26
  48.  
  49. End of test
  50.